package net.jblog.struts.backoffice.form;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class CategoryForm extends ActionForm {
	private static final long serialVersionUID = 1576482414276659176L;

	private Long id;
	private Long parent;
    
    private String name;
	private String description;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getParent() {
		return parent;
	}
	public void setParent(Long parent) {
		this.parent = parent;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Override
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		try {
	 		request.setCharacterEncoding("ISO-8859-1");
			this.setId(null);
			this.setParent(null);
			this.setName(null);
			this.setDescription(null);
		} catch (UnsupportedEncodingException e) {
	 		e.printStackTrace();
	 	}
	 	super.reset(mapping, request);
	}
}
